package com.cskaoyan.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;

/**
 * @author stone
 * @date 2022/11/12 09:26
 */
@Component
public class HelloAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {

        System.out.println("hello");
        Object proceed = methodInvocation.proceed();
        System.out.println("world");

        return proceed;
    }
}
